package Zuoye;



public class Test {
    public static void main(String[] args) {
        Dog[]dogs=new Dog[3];
        dogs[0]=new Dog("小黑",2,"黑色");
        dogs[1]=new Dog("效率",1,"绿色");
        dogs[2]=new Dog("小白",3,"白色");
        System.out.println(dogs[0].name);
        dogs[1].age=4;
        dogs[2].swim();
        for (int i=0;i<dogs.length;i++){
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }
        Chick[]chicks=new Chick[2];
        chicks[0]=new Chick("鲲鲲",2,"黄色");
        chicks[1]=new Chick("鸡哥",3,"白色");
        System.out.println(chicks[0].name);

        chicks[1].eat();
        for (int k=0;k<chicks.length;k++){
            System.out.println(chicks[1].name);
            chicks[k].eat();
        }
        Fish[]fish=new Fish[2];
        fish[0]=new Fish("鱼",2,"黑色");
        fish[1]=new Fish("虎皮",1,"绿色");
        for (int y=0;y<fish.length;y++){
            System.out.println(fish[y].name);
            fish[y].swim();
        }
    }

}
